package com.ziqikeji.xianyan.entity.tag;

import com.ziqikeji.xianyan.common.BaseEntity;
import com.ziqikeji.xianyan.entity.article.Article;

import javax.persistence.*;
import java.util.List;

/**
 * 标签 entity
 * @author liuyu
 */
@Entity
@Table(name = "tag")
public class ArticleTag extends BaseEntity {

    /**
     * 标签名
     */
    private String text;
    /**
     * 标签详情
     */
    private String description;
    /**
     * 文章
     */
    private List<Article> articleList;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "articleTagList")
    public List<Article> getArticleList() {
        return articleList;
    }

    public void setArticleList(List<Article> articleList) {
        this.articleList = articleList;
    }
}
